export const columns = [
  {
    dataIndex: 'name',
    key: 'name',
    title: '连接器名称'
  },
  {
    title: '类型',
    dataIndex: 'type',
    key: 'type',
    scopedSlots: { customRender: 'type' }
  },
  {
    title: '描述',
    dataIndex: 'detail',
    key: 'detail'
  },
  {
    title: '地址',
    dataIndex: 'baseUrl',
    key: 'baseUrl'
  },
  {
    title: '验证类型',
    dataIndex: 'validationType',
    key: 'validationType',
    scopedSlots: { customRender: 'validationType' }
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    key: 'createTime'
  },
  {
    title: '状态',
    key: 'state',
    dataIndex: 'state',
    scopedSlots: { customRender: 'state' }
  }
]

// 连接器类型映射字段
export const CONNECTOR_TYPE_MAP = {
  1: 'API',
  2: 'RABBITMQ',
  3: 'KAFKA',
  4: 'ROCKETMQ'
}

// 验证类型字段映射
export const VALIDATION_TYPE_MAP = {
  0: '无验证',
  1: 'OAUTH2认证',
  2: 'JWT',
  3: 'ACCOUNT',
  4: '自定义'
}

// 状态字段映射
export const STATE_MAP = {
  0: '停用',
  1: '启用'
}
// 接口实例类型颜色映射
export const API_TYPE_COLOR_MAP = {
  GET: '#6C9A2D',
  POST: '#50AEDF',
  KAFKA: '#000',
  RABBITMQ: '#DC8651',
  ROCKETMQ: '#DC8651'
}
// MQ类型文本映射
export const MQ_TYPE_MAP = {
  2: 'RABBITMQ',
  3: 'KAFKA',
  4: 'ROCKETMQ'
}
// 解析类型映射
export const RETURN_TYPE_MAP = {
  0: '否',
  1: '消息',
  2: '数据',
  3: '状态码',
  4: 'token'
}

export const AUTH_POSITION_MAP = {
  1: 'HEADER',
  2: 'QUERY'
}

// 解析字段类型映射
export const FIELD_TYPE_MAP = {
  string: '#43a047',
  // 'integer': '#eb2f96',
  boolean: '#f759ab',
  array: '#4caf50',
  object: '#1890ff',
  number: '#eb2f96',
  null: '#fa8c16'
}
// 参数表格表头
export const paramsColumns = [
  {
    title: '参数名称',
    dataIndex: 'parameterKey',
    key: 'parameterKey',
    scopedSlots: { customRender: 'parameterKey' }
  },
  {
    title: '描述',
    dataIndex: 'parameterValue',
    key: 'parameterValue',
    scopedSlots: { customRender: 'parameterValue' }
  },
  {
    title: '操作',
    key: 'action',
    scopedSlots: { customRender: 'action' }
  }
]
// header表格表头
export const headerColumns = [
  {
    dataIndex: 'parameterKey',
    key: 'parameterKey',
    slots: { title: 'parameterKeyTitle' },
    scopedSlots: { customRender: 'parameterKey' }
  },
  {
    dataIndex: 'parameterValue',
    key: 'parameterValue',
    slots: { title: 'parameterValueTitle' },
    scopedSlots: { customRender: 'parameterValue' }
  },
  {
    title: '操作',
    dataIndex: 'action',
    key: 'action',
    scopedSlots: { customRender: 'action' }
  }
]
// path表格表头
export const pathColumns = [
  {
    title: 'path变量',
    dataIndex: 'parameterKey',
    key: 'parameterKey'
  },
  {
    title: '描述',
    dataIndex: 'parameterValue',
    key: 'parameterValue',
    scopedSlots: { customRender: 'parameterValue' }
  }
]
// respone解析表格表头
export const responeColumns = [
  {
    dataIndex: 'parameterKey',
    width: 300,
    slots: { title: 'parameterKeyTitle' },
    scopedSlots: { customRender: 'parameterKey' },
    key: 'parameterKey'
  },
  {
    dataIndex: 'returnType',
    key: 'returnType',
    width: 120,
    slots: { title: 'returnTypeTitle' },
    scopedSlots: { customRender: 'returnType' }
  },
  {
    dataIndex: 'selfType',
    key: 'selfType',
    width: 100,
    slots: { title: 'selfTypeTitle' },
    scopedSlots: { customRender: '_selfType' }
  },
  {
    dataIndex: 'parameterName',
    key: 'parameterName',
    width: 100,
    slots: { title: 'parameterNameTitle' },
    scopedSlots: { customRender: 'parameterName' }
  },
  {
    dataIndex: 'parameterValue',
    key: 'parameterValue',
    width: 100,
    slots: { title: 'parameterValueTitle' },
    scopedSlots: { customRender: 'parameterValue' }
  },
  {
    dataIndex: 'action',
    key: 'action',
    width: 100,
    scopedSlots: { customRender: 'action' }
  }
]
// respone 认证配置解析表格表头
export const responeAuthColumns = [
  {
    dataIndex: 'parameterKey',
    width: 300,
    slots: { title: 'parameterKeyTitle' },
    scopedSlots: { customRender: 'parameterKey' },
    key: 'parameterKey'
  },
  {
    dataIndex: 'returnType',
    key: 'returnType',
    width: 120,
    slots: { title: 'returnTypeTitle' },
    scopedSlots: { customRender: 'returnType' }
  },
  {
    dataIndex: 'selfType',
    key: 'selfType',
    width: 100,
    slots: { title: 'selfTypeTitle' },
    scopedSlots: { customRender: '_selfType' }
  },
  {
    dataIndex: 'authPosition',
    key: 'authPosition',
    title: '参数位置',
    width: 100,
    scopedSlots: { customRender: 'authPosition' }
  },
  {
    dataIndex: 'authKey',
    key: 'authKey',
    title: '参数名称',
    width: 130,
    scopedSlots: { customRender: 'authKey' }
  },
  {
    dataIndex: 'parameterValue',
    key: 'parameterValue',
    width: 100,
    slots: { title: 'parameterValueTitle' },
    scopedSlots: { customRender: 'parameterValue' }
  },
  {
    dataIndex: 'action',
    key: 'action',
    width: 100,
    scopedSlots: { customRender: 'action' }
  }
]